
#ifndef __GAMEMAIN_H__
#define __GAMEMAIN_H__

#include "basetype.h"
#include <windows.h>

#include "2dDraw.h"
#include "GameInput.h"
#include "GameSound.h"
#include "GameMusic.h"
#include "GameClock.h"
#include "GameBitMap.h"

#include "GraphGdi.h"

class CGameMain
{
public:

	CGameMain();
	virtual ~CGameMain();

	int Init(HINSTANCE hinstance, LPTSTR lpcmdline, LPTSTR lpWndClassName, LPTSTR lpWndTitle, int WndWidth, int WndHeight, int bpp, BOOL bFullScreen);

	int	Run();

	int	Stop();
	//
	virtual int	Game_Init();
	virtual int	Game_Main();
	virtual int	Game_Shutdown();


protected:
	//
	HINSTANCE				m_hInstance;
	tstring					m_lpcmdline;

	//Windows param
	tstring					m_WndClassName;
	tstring					m_WndTitle;
	int						m_WndWidth;
	int						m_WndHeight;
	int						m_bpp;
	BOOL					m_bFullScreen;

	//HWnd
	HWND					m_hWnd;					// generic window handle

	int						m_Window_client_x0;		// used to track the starting (x,y) client area for
	int						m_Window_client_y0;		// for windowed mode directdraw operations

	CDDraw					m_ddraw;
	CGameInput				m_gameInput;
	CGameSound				m_gameSound;
	CGameMusic				m_gameMusic;
	CGameClock				m_gameClock;
	CBitMapFile				m_bitMapFile;

	CGraphGdi				m_graphGdi;
};

#endif